package com.zzvcom.utils.el;

import org.apache.commons.lang.StringUtils;

public class StringFunction
{
    public static String randStr(Object o,Integer max,String after) 
    {
             if(o!=null)
             {
                 String tmp=o.toString();
                 if(tmp.length()>max)
                 {
                     if(StringUtils.isBlank(after))
                     {
                         after="...";
                     }
                     return tmp.substring(0, max)+after;
                 }
                 else
                 {
                     return tmp;
                 }
                 
             }
             
             return "";
    }
    
    public static void main(String agrs[])
    {
        
        System.out.println("");        
    }

}
